package com.restaurant.application.indexes.consumptionlist.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.consumption.support.OrderData;
import com.restaurant.application.indexes.consumptionlist.AssistConsumptionListImpl;
import com.restaurant.application.indexes.consumptionlist.mysql.ConsumptionListCriteria;

public class AssistConsumptionListBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractAssistConsumptionList getImpl() {
        AbstractAssistConsumptionList inst = new AssistConsumptionListImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public AssistConsumptionListOutFace getUnitFace() {
        return new AssistConsumptionListOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch(name) {
            case "bandToCustomer":
                return getImpl().bandToCustomer((BandBean) param[0]);
            case "getOrderList":
                return getImpl().getOrderList((OrderData) param[0]);
            case "getHistory":
                return getImpl().getHistory();
            case "getTotal":
                return getImpl().getTotal((UID) param[0]);
            case "getId": return getImpl().getId();
            case "getFullView":
                setIsRefresher();
                return getImpl().getFullView();
            case "getViewLead":
                return getImpl().getViewLead((ViewSpec) param[0]);
            case "getEffectiveInterface": return getImpl().getEffectiveInterface();
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch(name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch(cmd) {
            case 0: return AbstractAssistConsumptionList.CMD_VIEWCONSUMPTION;
            case 1: return AbstractAssistConsumptionList.CMD_DOSEARCHPATH;
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch(cmd) {
            case 0: return getImpl().viewConsumption(seq);
            case 1: return getImpl().doSearchPath((ConsumptionListCriteria)param, seq);
        }
        return null;
    }
}
